<?php
/**
 * Yii view form
 *
 * @author luubk
 * @since Jan 11, 2013 - 2:46:02 PM
 */
?>

<div class="row-fluid">
    <?php
    $this->beginWidget('MyActiveForm', array(
        'model' => $this->model,
        'title' => $this->pageTitle,
        'htmlOptions' => array('class' => 'span6'),
        'columns' => array(
            'username',
            'email',
            array(
                'field' => 'new_pass',
                'type' => 'password'
            ),
        ),
    ));
    ?>
    <div class="grid span6">
        <div class="grid-title">
            <div class="pull-left"><?php echo Yii::t('auth', 'Role') ?></div>
            <div class="pull-right"></div>
            <div class="clear"></div>
        </div>
        <div class="grid-content">
            <div class="formRow">                
                <select class="span_select" name="role"> 
                    <option><?php echo Yii::t('admin', 'Select role') ?></option>
                    <?php $auth = Yii::app()->authManager; ?>
                    <?php echo $this->model->id ?>
                    <?php foreach ($auth->getRoles() as $item): ?>
                        <option value="<?php echo $item->name ?>" 
                                <?php echo $auth->isAssigned($item->name, $this->model->id) ? 'selected=""' : '' ?>>
                                    <?php echo $item->description ?>
                        </option>
                    <?php endforeach; ?>
                </select>   
            </div>
        </div>
    </div>
    <?php $this->endWidget() ?>
</div>